[qemu-dm] Check for null pointer in dma handler function pointer.
authorChristian Limpach <Christian.Limpach@xensource.com>
Tue, 24 Apr 2007 16:02:10 +0000 (17:02 +0100)
committerChristian Limpach <Christian.Limpach@xensource.com>
Tue, 24 Apr 2007 16:02:10 +0000 (17:02 +0100)
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
tools/ioemu/hw/dma.c

index ea13eae492b3c362f631b58b4f82a5588bbb9436..9ce330304b4217f356ef5b6d756c7259e06b7868 100644 (file)
@@ -340,6 +340,8 @@ static void channel_run (int ncont, int ichan)
 #endif
 
     r = dma_controllers[ncont].regs + ichan;
+    if (r->transfer_handler == NULL)
+       return;
     n = r->transfer_handler (r->opaque, ichan + (ncont << 2),
                              r->now[COUNT], (r->base[COUNT] + 1) << ncont);
     r->now[COUNT] = n;